﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BloomsburyBanHang.DTO
{
    public class DonDatHangDTO
    {


        public int MaDDH;


        public string TenDNNguoiDat;



        public DateTime NgayDat;



        public int TinhTrang;



        public double ThanhTien;

        public static DonDatHangDTO Convert(HOA_DON hd)
        {
            DonDatHangDTO ddh = new DonDatHangDTO();
            ddh.MaDDH = hd.MaHoaDon;
            ddh.TenDNNguoiDat = hd.TenDangNhap;
            ddh.NgayDat = (DateTime)hd.NgayDatHang;
            ddh.ThanhTien = 0;
            ddh.TinhTrang = 0;
            return ddh;
        }
        public static List<DonDatHangDTO> ListConvert(List<HOA_DON> lisHD)
        {
            List<DonDatHangDTO> result = new List<DonDatHangDTO>();
            foreach (var hd in lisHD)
            {
                result.Add(Convert(hd));
            }
            return result;
        }

    }
}